from kazoo.client import KazooState
from kazoo.client import KazooClient
import logging

logging.basicConfig()

def my_listener(state):
    if state == KazooState.LOST:
        print "KazooState.LOST"
    elif state == KazooState.SUSPENDED:
        print "KazooState.SUSPENDED"
    else:
        print "KazooState.CONN"

zk = KazooClient(hosts='192.168.99.110:2181', read_only=True)
zk.start()
zk.add_listener(my_listener)
zk.stop()